import 'package:flutter/material.dart';
import 'package:flutter_lib/utils/ToastUtils.dart';
import 'package:flutter_my_web/pages/tools/bilibili/bilibili_page.dart';
import 'package:flutter_my_web/pages/tools/drop_draw_board/drop_draw_board_page.dart';
import 'package:flutter_my_web/pages/tools/rename/rename_page.dart';
import 'package:flutter_my_web/utils/Utils.dart';
import 'package:flutter_my_web/widget/AppBarTitleWidget.dart';
import 'package:flutter_my_web/widget/BlueMaterialButton.dart';
import 'package:get/get.dart';

import 'change_file_str/change_file_str_page.dart';
import 'font_manager/IconManagerPage.dart' deferred as IconManagerPage;
import 'resizable_column/resizable_column_page.dart';
import 'web_plugin_test/web_plugin_test.dart';

class ToolsMainPage extends StatefulWidget {
  const ToolsMainPage({Key? key}) : super(key: key);

  @override
  _ToolsMainPageState createState() => _ToolsMainPageState();
}

class _ToolsMainPageState extends State<ToolsMainPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: AppBarTitleWidget("工具库"),
      ),
      body: Wrap(
        children: [
          BlueMaterialButton("网页提取", () async {
            Get.to(WebPluginTestPage());
          }),
          BlueMaterialButton("桌面版哔哩哔哩文件转化", () async {
            Get.to(BiliBiliPage());
          }),
          BlueMaterialButton("桌面GO图标查看器", () async {
            await IconManagerPage.loadLibrary();
            Get.to(IconManagerPage.IconManagerPage());
          }),
          BlueMaterialButton("本地文件传输", () async {
            // Get.to(ServerPage());
          }),
          BlueMaterialButton("批量修改文件名", () async {
            Get.to(ReNamePage());
          }),
          BlueMaterialButton("替换文件字符串", () async {
            Get.to(ChangeFileStrPage());
          }),
          BlueMaterialButton("调节宽度布局", () async {
            Get.to(ResizableColumnPage());
          }),
          BlueMaterialButton("拖拽画板", () async {
            Get.to(DropDrawBoardPage());
          }),
          BlueMaterialButton("画图板", () async {
            showSnackBar("等待开发");
          }),
          BlueMaterialButton("计算器", () {
            showSnackBar("等待开发");
          }),
          BlueMaterialButton("进制转换", () {
            showSnackBar("等待开发");
          }),
        ],
      ),
    );
  }
}
